<?php if (!defined('THINK_PATH')) exit();?><html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>菜单管理-公众平台管理</title>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" 	href="__PUBLIC__/css/bootstrap-theme.min.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/app.v2.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/jquery-ui.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/metro.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/autoreply.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/tiles.css" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/media.css" />
		
		<link rel="stylesheet" type="text/css"	href="__PUBLIC__/css/iphone-checkbox.css">
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/pagination.css">
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/menu.css">
		<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
		<script type="text/javascript" src="__PUBLIC__/js/jquery-ui.js"></script>
		<script type="text/javascript" src="__PUBLIC__/js/jquery.pagination.js"></script>
		<SCRIPT type="text/javascript" src="__PUBLIC__/js/iphone-style-checkbox.js"></SCRIPT>
		<SCRIPT type="text/javascript" src="__PUBLIC__/js/common.js"></SCRIPT>
		<script type="text/javascript" src="__PUBLIC__/js/highcharts/highcharts.js"></script>
		<style type="text/css">
.tiles .tile{
	position: relative;
}
.tiles .tile.current .sel{
 display: block;
}

</style>
		<script type="text/javascript">
	 		$(function(){
	 			$(".appmsg").click(function(){
	 				$(".msgs .current").removeClass("current");
	 				$(this).addClass('current');
	 			});
	 			$.ajax({
	 				url:"<?php echo U('WxMenu/get_menu');?>",
	 				dataType:"json",
	 				success:function(data){
	 					if(data.menu){
		 					var buttons=data.menu.button;
		 					for(var i=0;i<buttons.length;i++){
		 						create_button(buttons[i]);
		 					}
	 					}
	 					$('.ui-sortable').sortable({axis:"y"});;
	 				}
	 			});
	 			$("#add_nav_btn").click(function(){
	 				if($("#bizmenu .nav_item_level1_wrapper").size()==3){
	 					alert("最多只能创建 3 个一级菜单");
	 					return;
	 				}
	 				$('#add_menu_dialog').dialog({
						title:"添加菜单",
						width:300,
						modal:true,
						resizable:false,
						draggable:false,
						buttons:{'确定':function(){
							var name=$('#input_text').val();
							create_button({name:name,type:'',key:''});
							$(this).dialog("close");
						},'取消':function(){
						 	$(this).dialog("close");
						}}
					});
					$('#input_text').val('');
	 			});
	 			 
	 			$(".tab li").click(function () {
					$(".tab .selected").removeClass("selected");
					$(this).addClass("selected");
					$(".pane").hide();
					$($(this).attr("pane")).show();
				
				});
	 		});
	 		 
	 		function create_button(button){
	 			
	 			var btnId="level1_"+($("#bizmenu .nav_item_level1_wrapper").size()+1);
	 			var newButton= $($('#level1_templete').html());
				newButton.attr('id',btnId);
				newButton.attr('type',button.type);
				if(button.type=='click'){
					newButton.attr('key',button.key);
				}else{
					newButton.attr('url',button.url);
				}
				newButton.find('.nav_btn').html(button.name);
				newButton.find(".nav_item").click(setCurrentButton);
				newButton.find('.nav_opr_remove_btn').click(function(){
					newButton.remove();
				});
				newButton.find('.nav_opr_edit_btn').click(function(){
					var name=$('.cur').find('.nav_btn').text();
					$('#input_text').val(name);
					$('#add_menu_dialog').dialog({
						title:"编辑菜单",
						width:300,
						modal:true,
						resizable:false,
						draggable:false,
						buttons:{'确定':function(){
							var name=$('#input_text').val();
		 					newButton.find('.level1name').html(name);
							$(this).dialog("close");
						},'取消':function(){
						 	$(this).dialog("close");
						}}
					});
					
				});
				newButton.find('.nav_opr_add_btn').click(function(){
					$('#add_menu_dialog').dialog({
						title:"添加子菜单",
						width:300,
						modal:true,
						resizable:false,
						draggable:false,
						buttons:{'确定':function(){
							var name=$('#input_text').val();
							create_sub_button({name:name,type:'',key:''},btnId);
							$(this).dialog("close");
						},'取消':function(){
						 	$(this).dialog("close");
						}}
					});
					$('#input_text').val('');
				});
				newButton.appendTo("#bizmenu");
				
				if(button.sub_button && button.sub_button.length>0){
					var sub_buttons=button.sub_button;
					for(var j=0;j<sub_buttons.length;j++){
						create_sub_button(sub_buttons[j],newButton.attr('id'));
					}
				} else{
					newButton.attr('type',button.type);
					if(button.type='click'){
						newButton.attr('key',button.key);
					}else{
						newButton.attr('url',button.url);
					}
				}
				
				return newButton;
	 		}
	 		function create_sub_button(button,parentId){
	 			 
	 			var newButton=$($('#level2_templete').html());
	 			var sub_nav=$($("#"+parentId).find(".sub_nav_list").get(0));
	 			
	 			newButton.attr('type',button.type);
				if(button.type=='click'){
					var key=button.key;
					newButton.attr('key',key);
					
					if(key.indexOf('view_msg')==0){
						newButton.find('.nav_icon i').addClass('fa fa fa-envelope');
					}else{
						newButton.find('.nav_icon i').addClass('fa fa-cloud');
					}
				}else{
					newButton.attr('url',button.url);
					newButton.find('.nav_icon i').addClass('fa fa-globe');
				}
	 			
	 			newButton.find('.nav_btn').html(button.name);
	 			newButton.find(".nav_item").click(setCurrentButton);
	 			newButton.find('.nav_opr_remove_btn').click(function(){
					newButton.remove();
				});
				newButton.find('.nav_opr_edit_btn').click(function(){
					var name=$('.cur').find('.nav_btn').text();
					$('#input_text').val(name);
				 	$('#add_menu_dialog').dialog({
						title:"编辑菜单",
						width:300,
						modal:true,
						resizable:false,
						draggable:false,
						buttons:{'确定':function(){
							var name=$('#input_text').val();
		 					newButton.find('.nav_btn').html(name);
							$(this).dialog("close");
						},'取消':function(){
						 	$(this).dialog("close");
						}}
					});
				});
	 			newButton.appendTo(sub_nav);
	 		}
	 		function setCurrentButton(){
	 			var $this=$(this);
	 			var $parent=$this.parent();
	 			$('.nav_item').removeClass("cur");
	 			$this.addClass("cur");
	 			$("#action_container").show();
	 			var type=$this.parent().attr("type");
	 		
	 			if(type=='click'){
	 				var key=$parent.attr("key");
	 				if(key.indexOf('view_msg_')==0){
	 					var id=key.substring(9,key.length);
	 					sendmsg(id);
	 				}else if(key.indexOf('view_app_')==0){
	 					var id=key.substring(9,key.length);
	 					$('.tiles .current').removeClass('current');
						$('#app'+id).addClass('current');
	 					sendapp();
	 				}
	 				
	 			} else if(type=='view'){
	 				sendurl();
	 				var url=$parent.attr("url");
	 				$('#input_url').val(url);
	 			}else{
	 				var sub_nav_list=$parent.parent().find('.sub_nav_list');
	 				  
	 				showIndex();
	 			}
	 			
	 		}
	 	 	function resume(){
	 	 		$.ajax({
	 	 			url:"<?php echo U('WxMenu/resume_menu');?>",
	 	 			dataType:'json',
	 	 			success:function(data){
	 	 				if(data){
	 	 					$('#bizmenu').html('');
		 					var buttons=data.button;
		 					for(var i=0;i<buttons.length;i++){
		 						create_button(buttons[i]);
		 					}
		 					$('.ui-sortable').sortable({axis:"y"});;
	 	 				}
	 	 			}
	 	 		});
	 	 	}
	 		function save(){
	 			var json='{"button":[';
	 			var items=$("#bizmenu .nav_item_level1_wrapper");
	 			for(var i=0;i<items.size();i++){
	 				var item=$(items.get(i));
	 				json+='{';
	 				json+='"name":"'+item.find('.level1name').html()+'",';
	 				var sub=item.find('.sub_nav_list').get(0);
	 				var level2=$(sub).find('.nav_item_level2_wrapper');
	 				if(level2.size()>0){
	 					json+='"sub_button":[';
	 					for(var j=0;j<level2.size();j++){
	 						var l=$(level2.get(j));
	 						json+='{'
	 						json+='"name":"'+l.find('.level2name').html()+'",';
	 						var type=l.attr('type');
	 						json+='"type":"'+type+'",';
	 						if(type=='click'){
	 							json+='"key":"'+l.attr('key')+'"';
	 						}else{
	 							json+='"url":"'+l.attr('url')+'"';
	 						}
	 						
	 						json+='}';
	 						if(j!=level2.size()-1){
			 					json+=',';
			 				}
	 					}
	 					json+=']}';
	 					
	 				}else{
	 					var type=item.attr('type');
 						json+='"type":"'+type+'",';
 						if(type=='click'){
 							json+='"key":"'+item.attr('key')+'"';
 						}else{
 							json+='"url":"'+item.attr('url')+'"';
 						}
		 				json+='}';
	 				}
	 				if(i!=items.size()-1){
	 					json+=',';
	 				}
	 			}
	 			json+="]}";
	 			$.ajax({
	 				url:"<?php echo U('WxMenu/create_menu');?>",
	 				type:"post",
	 				data:{"json":json},
	 				dataType:'json',
	 				success:function(data){
	 					if(data.errcode==0){
	 						showMessage('菜单发布成功，你可以用微信查看效果！');
	 					}else{
	 						alert("菜单发布失败，原因："+data.errmsg);
	 					}
	 				}
	 			});
	 		}
	 		function sendurl(){
	 			$('#url').show();
	 			$('#app').hide();
	 		 	$('#input_url').val('');
	 			$('#index').hide();
	 			$('#edit').hide();
	 			
	 		}
	 		
	 		function  sendapp(){
	 			$('#app').show();
	 			 
	 		 	$('#index').hide();
	 			$('#url').hide();
	 			$('#edit').hide();
	 		}
	 		function sendmsg(id){
	 	 
	 			$('#index').hide();
	 			$('#url').hide();
				$('#app').hide();
	 			$('#edit').show();
				$('.msgs .current').removeClass("current");
	 			$('.msgs #'+id).addClass("current");
	 		}
	 		function showIndex(){
	 			$('#index').show();
	 			$('#url').hide();
	 			$('#edit').hide();
	 			$('#app').hide();
	 		}
	 		function saveMsg(){
	 			var id=$('.msgs .current').first().attr('id');
	 			$('.cur').parent().attr('type','click');
				$('.cur').parent().attr('key','view_msg_'+id);
				$('.cur').parent().attr('val','view_msg');
				$('.cur').find(".nav_icon i").attr('class',"fa fa fa-envelope");
				showMessage("绑定成功");
	 		}
	 		function saveUrl(){
	 			$('.cur').parent().attr('type','view');
	 			$('.cur').parent().attr('url',$('#input_url').val());
	 			$('.cur').find(".nav_icon i").attr('class',"fa fa-globe");
	 			showMessage("绑定成功");
	 		}
	 		function saveApp(){
	 			var aid=$('.tiles .current').first().attr('aid');
	 			$('.cur').parent().attr('type','click');
	 			$('.cur').parent().attr('key','view_app_'+aid);
	 			$('.cur').parent().attr('val','view_app');
	 			$('.cur').find(".nav_icon i").attr('class',"fa fa-cloud");
	 			showMessage('绑定成功');
	 		}
	 		function bind(){
	 			$.ajax({
	 				url:"bind.json",
	 				type:"post",
	 				data:{appid:$('#input_appid').val(),'secret':$('#input_secret').val()},
	 				dataType:'json',
	 				success:function(data){
	 					if(data.success){
	 						showMessage('绑定成功');
	 						location.reload();
	 					}else{
	 						alert(data.message);
	 					}
	 				}
	 			});
	 		}
	 		function setApp(li){
	 			$('.tiles .current').removeClass('current');
	 			$(li).addClass('current');
	 		}
	 		function preview(){
	 			var frame=$('#menu-preview .frame').first();
	 			frame.empty();
	 			var items=$("#bizmenu .nav_item_level1_wrapper");
	 			
	 			var buttons="<img src='__PUBLIC__/img/close.png' class='close' onclick='hidePreview()'/><div class='menu-pane'><ul id='submenu'></ul><ul class='buttons'>";
	 			for(var i=0;i<items.size();i++){
	 				var item=$(items.get(i));
	 				buttons+="<li class='button'>"+item.find('.level1name').html()+"</li>";
	 			}
	 			buttons+="</ul></div>"
	 			$(buttons).appendTo(frame);
	 			$('.buttons .button').click(function(){
	 				var index=$(".buttons .button").index(this);
	 				var level2=$(items.get(index)).find(".nav_item_level2_wrapper");
	 				var menus="";
	 				for(var i=0;i<level2.size();i++){
	 					menus+="<li class='menu'>"+$(level2.get(i)).find('.level2name').html()+"</li>";
	 				}
	 				$('#submenu').html(menus);
	 				$('#submenu').css("left",(index*55+27)+"px");
	 			});
				$('#menu-preview').show();
	 		}
	 		function hidePreview(){
	 			$("#menu-preview").hide();
	 			
	 		}
	 	</script>
	</head>
	<body>
		<div id='nav_opr_list '>
			<ul class="nav_opr_list ">
				<li class="nav_opr_item">
					<a title="添加子菜单" class="nav_opr_btn nav_opr_add_btn"
						href="javascript:;"><i class="opr_icon16 add_icon"></i> </a>
				</li>
				<li class="nav_opr_item">
					<a title="改名" class="nav_opr_btn nav_opr_edit_btn"
						href="javascript:;"><i class="opr_icon16 edit_icon"></i> </a>
				</li>
				<li class="nav_opr_item">
					<a title="删除" class="nav_opr_btn nav_opr_edit_btn"
						href="javascript:;"><i class="opr_icon16 del_icon"></i> </a>
				</li>
				<li class="nav_opr_item">
					<a title="排序" class="nav_opr_btn nav_opr_sort_btn"
						href="javascript:;"><i class="opr_icon16 sort_icon_primary"></i>
					</a>
				</li>
			</ul>
		</div>

		<!-- 头部 -->
		
<div id="header" class="header">
	<div class="logo_area" style="display: none;">
		<div class="wrapper">
			<img alt="微信公众平台" src="__PUBLIC__/img/autoreply/logo15def7.png">
			<div class="hd_login_info" style="margin-right: 10px;">
				<div style="display: inline-block;vertical-align: middle;">
					<a style="padding-right: 0;" href="#">你好，${customer.name}</a>
					<div > 
						<a href="../manager/setting.json">设置</a> <a
						href="../login/logout.json">退出</a>
					</div>
				</div>
				<img src="__PUBLIC__/img/default.png" width="40px;" style="vertical-align: middle;">
			</div>
		</div>
	</div>
	<div class="navigator">
	<div class='logopane' >
		<img style=";margin-left: 10px;position: absolute;top: 5px;" width="40px" src='__PUBLIC__/img/oper_weixin.png'/>
		<span style="font-size:24px;color:#fff;left:50px;position: absolute;top: 5px;">公众平台接入管理</span>
	</div>
	<ul class="textLarge">
	<?php if(is_array($menuList)): $i = 0; $__LIST__ = $menuList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$m): $mod = ($i % 2 );++$i;?><li>
			<a href='<?php echo U("m.menu/index");?>'><i class="fa fa-home"></i><?php echo ($m["title"]); ?></a>
		</li><?php endforeach; endif; else: echo "" ;endif; ?>
		<li>
			<a href='<?php echo U("Manage/index");?>'><i class="fa fa-home"></i>首页</a>
		</li>
		<li>
			<a href='<?php echo U("Rbac/index");?>'><i class="fa fa-cogs"></i>系统管理</a>
		</li>
		<li>
			<a href='<?php echo U("Message/material");?>'><i class="fa fa-picture-o"></i>素材管理</a>
		</li>
		<li>
			<a href='<?php echo U("Reply/index");?>'><i	class="fa fa-comments-o"></i>消息回复</a>
		</li>
		<li>
			<a href='<?php echo U("WxMenu/index");?>'><i class="fa fa-list-ul"></i>自定义菜单</a>
		</li>
		<li>
			<a href='/sms/index.json' target="_blank"><i
				class="fa fa-comment"></i>实时消息</a>
		</li>
	</ul>
	<ul class="textLarge" style="float: right;;">
		<li style="width: 50px;border-left: 1px solid rgba(0,0,0,0.2);font-size: 16px;">
			<a href='/manager/setting.json'><i	class="fa fa-cog"></i></a>
		</li>
		<li  style="width: 50px;border-left: 1px solid rgba(0,0,0,0.2);font-size: 16px;">
			<a href='<?php echo U("Index/logout");?>'><i	class="fa fa-power-off"></i></a>
		</li>
	</ul>
</div>
</div> 
		<div class="slimScrollDiv"
			style="position: fixed; overflow: hidden; width: 250px; top: 45px;height: 100%">
			<aside id="left_panel"
				style="overflow: hidden; width: 250px; height: 100%">

			<nav id="aside_nav">
			<ul class='tab'>
				<li class=" selected" pane="#pane1">
					<a>授权设置<i class="fa fa-angle-right right"></i> </a>
				</li>
				<li class=" " pane="#pane2">
					<a>菜单设置<i class="fa fa-angle-right right"></i> </a>
				</li>
			</ul>
			</nav>
			</aside>
		</div>
		<input type="hidden" name="id" value="<?php echo ($profile["id"]); ?>">
		<section id="main_content">

		<div class="container-fluid">
			<ol class="breadcrumb">
				<li>
					<a href="<?php echo U('Manage/index');?>">首页</a>
				</li>
				<li>
					自定义菜单
				</li>
			</ol>
			<div class='col-md-12'>
				<div id='pane1' class='pane panel'
					style="display: block; position: relative;">
					<div class="bizmenu_edit_area">
						 
						<div class="page-header">
							<h1>
								授权设置
								<small>使用本模块，必须要在微信公众平台"开发模式"下使用自定义菜单，首先要在公众平台申请自定义菜单使用的AppId和AppSecret。</small>
							</h1>
						</div>
						<div class="form-horizontal left-label" style="margin-top: 30px">
								<div class="form-group">
									<label class="control-label col-lg-2">
										AppId：
									</label>
									<div class="col-lg-6">
										<input type="text" id="input_appid" placeholder="输入AppId"
												value="<?php echo ($_SESSION['profile_appid']); ?>"
												class="form-control">
									</div>
								</div>
								
								<div class="form-group">
									<label class="control-label col-lg-2">
										AppSecret：
									</label>
									<div class="col-lg-6">
										<input type="text" id="input_secret"
												placeholder="输入AppSecret"
												value="<?php echo ($_SESSION['profile_secret']); ?>"
												class="form-control">
									</div>
								</div>
							
							
							<div class="frm" style="display: block;">
								<div class="frm_bd">
							 
								</div>
								<div class="tool_bar" style="margin-top: 20px">
									<a href="javascript:void(0);" class="btn btn-med blue-bg" onclick="bind()">保存设置</a>
								</div>
							</div>

						</div>
					</div>
				</div>
				<div id='pane2' class='pane panel' style="position: relative; display: none;">
					<div style="padding-left: 20px;padding-right: 20px">
					<?php if(is_null($_SESSION['access_token'])): ?><div id="noEditSign" class="noEditLayer" style="display: block;"></div>
					<?php else: endif; ?>
					<div class="page-header">
	<h1>
		菜单设置 <small>你可以创建最多 3 个一级菜单，每个一级菜单下可以创建最多 5
			个二级菜单。编辑中的菜单不会马上被用户看到，可以放心调试。</small>
	</h1>
</div>
<div class="boxBody bizmenu group">
	<div class="left sidebar_primary">
		<div class="area_hd">
			<h4 class="oh z area_t">
				<span class="area_t_text">菜单管理</span>
				<span class="area_t_opr"> <i  class="fa fa-bars"  	id="sort"></i>
				</span>
				 <span class="area_t_opr"
					id='add_nav_btn'> <i class='fa fa-plus'></i>  
				</span>
			</h4>
		</div>
		<div class="area_bd">
			<div class="nav_list ui-sortable " id="bizmenu">

			</div>
		</div>
	</div>
	<div class="main_primary oh z">
		<div class="area_hd">
			<h4 class="area_t">设置动作</h4>
		</div>
		<div class="area_bd">
			<div id="action_container" class="send">

				<div class="action_area">
					<div id='index' class="action_type" style="padding-top: 40px;display: none">
						<a class="action_btn sendmsg" href="javascript:;"
							onclick="sendmsg()"> <i class="action_icon send_icon"></i><strong
							class="action_btn_text">绑定消息 </strong>
						</a> <a class="action_btn sendapp" href="javascript:;"
							onclick="sendapp()"> <i class="action_icon search_icon"></i><strong
							class="action_btn_text">绑定应用 </strong>
						</a> <a class="action_btn " href="javascript:;"
							onclick="sendurl()"> <i class="action_icon url_icon"></i><strong
							class="action_btn_text">绑定网页 </strong>
						</a>
					</div>
					<div id='app' class="frm">
						<div class="panel-heading  ">
							<h3 class="panel-title">打开应用</h3>
						</div>
						<div class="frm_bd">
							<div class="frm_control_group" id="frm_control_group">

								<div class='chioseDiv tiles'>
								<?php if(is_array($myApps)): $i = 0; $__LIST__ = $myApps;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$app): $mod = ($i % 2 );++$i; if($app["event"] == 'menu'): ?><div class="tile ${tileColor }   left" onclick="setApp(this)"		id='app<?php echo ($app["id"]); ?>' aid='<?php echo ($app["id"]); ?>'>
												<div class="tile-body text-center">
													<i class='<?php echo ($app["icon"]); ?>  med'></i>
													<p class="bottom"><?php echo ($app["name"]); ?></p>
												</div>
												<img src='__PUBLIC__/img/big_sel.png' class='sel'>
											</div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
									
								</div>
							</div>
						</div>
						<div class="tool_bar">
							<a id="editBack" class="red-bg btn" onclick="showIndex()">重新选择</a>
							<a id="editSave" class="blue-bg btn" onclick="saveApp()">绑定应用</a>
						</div>
					</div>
					<div id='url' class="frm form-horizontal left-label">
						<div class="form-group">
							<div class="panel-heading  ">
								<h3 class="panel-title">打开URL</h3>
							</div>
							<div class="col-lg-8">
								<input type="text" class="form-control" placeholder="输入URL"
									id="input_url">
							</div>
						</div>

						<div>
							<a id="editBack" class="red-bg btn" onclick="showIndex()">重新选择</a>
							<a id="editSave" class="blue-bg btn" onclick="saveUrl()">绑定URL</a>
						</div>
					</div>
					<div id="edit" class="action_content send jsMain"
						style="display: none">
						<div class="panel-heading  ">
							<h3 class="panel-title">打开消息</h3>
						</div>
						<div class='msgs'>
						<?php if(is_array($graphics)): $i = 0; $__LIST__ = $graphics;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$gra): $mod = ($i % 2 );++$i;?><div class="appmsg " id="<?php echo ($gra["id"]); ?>">
						       <?php if(is_array($gra['articles'])): $i = 0; $__LIST__ = $gra['articles'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$art): $mod = ($i % 2 );++$i; if($i == 0): ?><div class='item'>
											<div class="appmsg_content">
												<h4 class="appmsg_title"><?php echo ($art["head_title"]); ?></h4>
												<div class="appmsg_info">
													<em class="appmsg_date"></em>
												</div>
												<div class="appmsg_thumb_wrp">
													<img src="<?php echo U('File/downLoad');?>/id/<?php echo ($art["img_id"]); ?>" style="width: 310px;height: 160px" 	class="appmsg_thumb">
												</div>
												<p class="appmsg_desc"><?php echo ($art["summary"]); ?></p>
											</div>
											 
										</div>
						       <?php else: ?>
						       <div id="appmsgItem2" class="appmsg_item js_appmsg_item " data-id="3" data-fileid="">
												<img class="js_appmsg_thumb appmsg_thumb" style="width:310px;height:160px"  src="<?php echo U('File/downLoad');?>/id/<?php echo ($art["img_id"]); ?>">
												<h4 class="appmsg_title" >
													<a target="_blank" href="javascript:void(0);" onclick="return false;"><?php echo ($art["head_title"]); ?></a>
												</h4>
											</div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
									<img src='__PUBLIC__/img/big_sel.png' class='sel'>
						</div><?php endforeach; endif; else: echo "" ;endif; ?>
						
						</div>
						<div class="tool_bar" style="margin-left: 20px;margin-top: 0px">
							<a id="editBack" class="red-bg btn" onclick="showIndex()">重新选择</a>
							<a id="editSave" class="blue-bg btn" onclick="saveMsg()">绑定消息</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="pre_access_wrapper m-t" >
	<a class="blue-bg btn btn-med showcase-btn pull-right"   onclick="resume()"  >从备份恢复</a>
	<a class="orange-bg btn btn-med showcase-btn pull-right""   onclick="preview()">预览</a> 
	<a class="blue-bg btn btn-med showcase-btn pull-right"   onclick="save()" id="use">发布</a>
	
</div>

					</div>
				</div>
			</div>
		</div>
		</section>
		<!-- 底部 -->
		<div id="footer" class="footer">

		</div>
		<div id='msgTip'></div>
		<div id="add_menu_dialog" class="col-lg-6" style="display: none;">
			<input type='text' id='input_text' class='form-control' style="width: 100%">
		</div>
		<div id='level2_templete'>
			<div class="nav_item_wrapper nav_item_level2_wrapper">
				<div class="nav_item level2 sortable" data-domid="1">
					<div class="nav_bd">
						<span class="nav_icon"><i></i>
						</span>
						<ul class="nav_opr_list">
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_edit_btn"
									title="改名"><i class="opr_icon16 edit_icon"></i> </a>
							</li>
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_remove_btn"
									title="删除"><i class="opr_icon16 del_icon"></i> </a>
							</li>
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_sort_btn"
									title="排序"><i class="opr_icon16 sort_icon_primary"></i> </a>
							</li>
						</ul>
						<h5 class="nav_t">
							<a href="javascript:;" title="" data-domid="1"
								class="level2name nav_btn"></a>
						</h5>
					</div>
				</div>
			</div>
		</div>
		<div id='level1_templete'>
			<div id="level" data-domid="0"
				class="nav_item_wrapper nav_item_level1_wrapper  ">
				<div class="nav_item level1" data-domid="0">
					<div class="nav_bd">
						<span class="nav_icon"><i class="opr_icon16 switch_icon"></i>
						</span>
						<ul class="nav_opr_list">
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_add_btn"
									title="添加子菜单"><i class="opr_icon16 add_icon"></i> </a>
							</li>
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_edit_btn"
									title="改名"><i class="opr_icon16 edit_icon"></i> </a>
							</li>
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_remove_btn"
									title="删除"><i class="opr_icon16 del_icon"></i> </a>
							</li>
							<li class="nav_opr_item">
								<a href="javascript:;" class="nav_opr_btn nav_opr_sort_btn"
									title="排序"><i class="opr_icon16 sort_icon_primary"></i> </a>
							</li>
						</ul>
						<h4 class="nav_t">
							<a href="javascript:;" title="" class="level1name nav_btn"></a>
						</h4>
					</div>
				</div>
				<div class="sub_nav_list ui-sortable " data-domid="0"></div>
			</div>
		</div>
		<div id="menu-preview" align='center' style="display: none">
		
			<div class='frame' >
				<div class='menu-pane'>
					<ul id='submenu'>
						<li class='menu'>关于我们</li>
						<li class='menu'>关于我们</li>
						<li class='menu'>关于我们</li>
					</ul>
					
					<ul class="buttons">
						<li class='button'><span>关于我们</span></li>
						<li class='button'><span>关于我们</span></li>
						<li class='button'><span>关于我们</span></li>
					</ul>
				</div>
				
			</div>
			
		</div>
	</body>
</html>